﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceDog.Lib.Generic
{
    public class VectorDelegates
    {
        /// <summary>
        /// 用于排序的方法
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public static int Compare(Vector x,Vector y)
        {
            if (x.R>y.R)
            {
                return 1;
            }
            else if(x.R<y.R)
            {
                return -1;
            }
            return 0;
        }
        /// <summary>
        /// 用于搜索的方法
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public static bool TopRightQuadrant(Vector target)
        {
            if (target.Theta>=0.0D && target.Theta<=90.0D)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
